import request from '@/utils/request'

export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 获取简单信息列表
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}

// 封装新增部门api
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 封装删除部门api
export function delDepartment(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}

// 封装根基id获取部门详情
export function getDepartDetail(id) {
  return request.get(`/company/department/${id}`)
}

// 根据id修改部门信息
export function updateDepartments(id, data) {
  return request.put(`/company/department/${id}`, data)
}
